--------------------------------------
---- Raeli's Spell Announcer Core ----
--------------------------------------
RSA = LibStub("AceAddon-3.0"):NewAddon("RSA", "AceConsole-3.0", "LibSink-2.0")
local L = LibStub("AceLocale-3.0"):GetLocale("RSA")
local db
local defaults = {
	global = {
		version = 1.0,
	},
	profile = {
		Modules = {
			['*'] = false,
		},
		General = {
			['*'] = true,
			Class = "",
			GlobalAnnouncements = {
				['*'] = true,
				InPvP = false,
				InWorld = false,
				OnlyInCombat = false,
				Battlegrounds = false,
			},
			Local = {
				['*'] = true,
			},
			GlobalCustomChannel = "MyCustomChannel",
		},
		Reminders = {
			DisableInPvP = true,
			EnableInSpec1 = true,
			EnableInSpec2 = false,
			--[[ Not Important for now. Maybe eventually auto rebuffing will return.
			ScrollWheel = {
				Enabled = false,
				WheelUp = "",
				WheelDown = ""
			},]]--
			CheckInterval = 10,
			RemindInterval = 15,
			RemindChannels = {
				['*'] = true,
			},
		},
		sink20OutputSink = "ChatFrame", -- Default for LibSink-2.0
		--sink20ScrollArea = ,
		DeathKnight = {
			Reminders = {
				SpellName = "",
			},
			Spells = {
				Army = {
					Messages = {
						Start = "Casting [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = true,
					},
				}, -- End
				AMS = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DarkCommand = {
					Messages = {
						Start = "Taunted [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				IceboundFortitude = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Strangulate = {
					Messages = {
						Start = "Strangulated [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				MindFreeze = {
					Messages = {
						Start = "Mind Freezed [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DeathGrip = {
					Messages = {
						Start = "Death Gripped [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				VampiricBlood = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				BoneShield = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				UnholyFrenzy = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				RuneTap = {
					Messages = {
						Start = "Activated [LINK] for [AMOUNT]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DancingRuneWeapon = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				WotN = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DeathPact = {
					Messages = {
						Start = "Activated [LINK] for [AMOUNT]!!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				RaiseAlly = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End				
			},
		},
		Druid = {
			Reminders = {
				SpellName = "",
			},
			Spells = {
				SurvivalInstincts = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Cyclone = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				FrenziedRegeneration = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Hibernate = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Innervate = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				SkullBash = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Growl = {
					Messages = {
						Start = "Taunted [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Revive = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Rebirth = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				TreeOfLife = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Barkskin = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Thorns = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				Tranquility = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				ChallengingRoar = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Berserk = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				RemoveCorruption = {
					Messages = {
						Start = "Removed [TARGET]'s [AURALINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				Roots = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Soothe = {
					Messages = {
						Start = "Purged [TARGET]'s [AURALINK]!",
						End = "[TARGET] resisted [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				StampedingRoar = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = true,
					},
				}, -- End
				SolarBeam = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End				
			},
		},
		Hunter = {
			Reminders = {
				SpellName = "",
			},
			Spells = {
				Misdirection = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				WidowVenom = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End				
				ConcussiveShot = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End				
				ScatterShot = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				FreezingTrap = {
					Messages = {
						Placement = "[LINK] Placed!",
						Start = "[LINK] hit [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End				
				SilencingShot = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End				
				TranquilizingShot = {
					Messages = {
						Start = "Removed [TARGET]'s [AURALINK]!",
						End = "[TARGET] resisted [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				WyvernSting = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End	
				Deterrence = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				Camoflage = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End				
				DistractingShot = {
					Messages = {
						Start = "Taunted [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = true,
					},
				}, -- End
				
			},			
		},
		Mage = {
			Reminders = {
				SpellName = "Molten Armor",
			},
			Spells = {
				TimeWarp = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Spellsteal = {
					Messages = {
						Start = "Stole [TARGET]'s [AURALINK]!",
						End = "[TARGET] resisted [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Polymorph = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Counterspell = {
					Messages = {
						Start = "Counterspelled [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Portals = {
					Messages = {
						Start = "Casting [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Teleport = {
					Messages = {
						Start = "Warning you are Teleporting, and leaving your friends behind!",
					},
					Local = true,
				}, -- End
				RefreshmentTable = {
					Messages = {
						Start = "Casting [LINK], please assist!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				RingOfFrost = {
					Messages = {
						Start = "[LINK] activated!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Cauterize = {
					Messages = {
						Start = "[LINK] activated, please heal me!",
						End = "[LINK] faded, I'm no longer burning!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				IceBlock = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				FocusMagic = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End				
			},
		},
		Paladin = {
			Reminders = {
				SpellName = "Righteous Fury",
			},
			Spells = {
				ArdentDefender = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				AuraMastery = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DivineProtection = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Forbearance = {
					Messages = {
						Start = "",
						End = "[LINK] on [TARGET] faded!",
					},
					Local = false,
				}, -- End
				DivineGuardian = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				HandOfFreedom = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				HandOfProtection = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				HandOfSacrifice = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				HandOfSalvation = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				LayOnHands = {
					Messages = {
						Start = "[LINK] on [TARGET] for [AMOUNT]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				GoAK = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Repentance = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Rebuke = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				HandOfReckoning = {
					Messages = {
						Start = "Taunted [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				RighteousDefense = {
					Messages = {
						Start = "Taunted [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Beacon = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = true,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				HammerOfJustice = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Redemption = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				AvengersShield = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "",
						Immune = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = true,
					},
				}, -- End
				TurnEvil = {
					Messages = {
						Start = "[LINK] [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				HolyRadiance = {
					Messages = {
						Start = "[LINK] activated, stand close to me if it's safe!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DivinePlea = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				HammerOfJustice = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End				
			},
		},
		Priest = {
			Reminders = {
				SpellName = "Inner Fire",
			},
			Spells = {
				LeapOfFaith = {
					Messages = {
						Start = "Pulling [TARGET] to Me!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				DivineHymn = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] over!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				HymnOfHope = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] over!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				FearWard = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = true,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				Levitate = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				ShackleUndead = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DispelMagic = {
					Messages = {
						Start = "Dispelled [AURALINK] on [TARGET]!",
						End = "[TARGET] resisted [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
					HostileOnly = true,
				}, -- End
				GuardianSpirit = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
						Proc = "[LINK] just healed [TARGET] for [AMOUNT]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				PainSuppression = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Lightwell = {
					Messages = {
						Start = "[LINK] activated!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				PowerInfusion = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				LightwellRenew = {
					Messages = {
						Start = "[TARGET] has clicked the Lightwell!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = true,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				PowerWordBarrier = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				CureDisease = {
					Messages = {
						Start = "Cured [TARGET]'s [AURALINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				Resurrection = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Fade = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				PsychicScream = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				MindSoothe = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				MindControl = {
					Messages = {
						Casting = "Casting [LINK] on [TARGET]!",
						Start = "Mindcontrolling [TARGET] Now!",						
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End				
			},
		},
		Rogue = {
			Reminders = {
				SpellName = "",
			},
			Spells = {
				Sap = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Blind = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
						Resist = "My [LINK] [MISSTYPE] [TARGET]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Kick = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Dismantle = {
					Messages = {
						Start = "Dismantled [TARGET]!",
						End = "[LINK] faded from [TARGET]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Tricks = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] gave you an additional [AMOUNT] damage!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
			},
		},
		Shaman = {
			Reminders = {
				SpellName = "",
			},
			Spells = {
				Hex = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Heroism = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				BindElemental = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				WindShear = {
					Messages = {
						Start = "Interrupted [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Purge = {
					Messages = {
						Start = "Purged [TARGET]'s [AURALINK]!",
						End = "[TARGET] resisted [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				CleanseSpirit = {
					Messages = {
						Start = "Cleansed [TARGET]'s [AURALINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				ManaTide = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				AncestralSpirit = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
			},
		},
		Warlock = {
			Reminders = {
				SpellName = "Fel Armor",
			},
			Spells = {
				SoulWell = {
					Messages = {
						Start = "Casting [LINK], please assist!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				SummonStone = {
					Messages = {
						Start = "Casting [LINK], please assist!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Suffering = {
					Messages = {
						Start = "Taunted [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				SingeMagic = {
					Messages = {
						Start = "[LINK] on [TARGET] removed [AURALINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				Banish = {
					Messages = {
						Start = "Banished [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Fear = {
					Messages = {
						Start = "Fearing [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Seduce = {
					Messages = {
						Start = "Seducing [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				SpellLock = {
					Messages = {
						Start = "Spell Locked [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Devour = {
					Messages = {
						Start = "Devoured [TARGET]'s [AURALINK]!",
						End = "[TARGET] resisted [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Soulstone = {
					Messages = {
						Start = "Soulstoned [TARGET]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = true,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				DeathCoil = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				Shadowfury = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End		
				HowlOfTerror = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				DarkIntent = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End				
			}, -- End Spells
		}, -- End Warlock
		Warrior = {
			Reminders = {
				SpellName = "",
			},
			Spells = {
				ShatteringThrow = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				ShieldWall = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				ChallengingShout = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Pummel = {
					Messages = {
						Start = "Pummeled [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Disarm = {
					Messages = {
						Start = "Disarmed [TARGET]!",
						End = "[TARGET] is armed again!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				ShieldBash = {
					Messages = {
						Start = "Shield Bashed [TARGET]'s [TARLINK]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Taunt = {
					Messages = {
						Start = "Taunted [TARGET]!",
						End = "My [LINK] [MISSTYPE] [TARGET]!",
						Immune = "[TARGET] is [MISSTYPE] to my [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Vigilance = {
					Messages = {
						Start = "[LINK] cast on [TARGET]!",
						End = "[LINK] on [TARGET] ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				LastStand = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				EnragedRegeneration = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				ShieldBlock = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				SpellReflect = {
					Messages = {
						Start = "Reflected [TARGET]'s [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Whisper = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Throwdown = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = true,
						Say = false,
					},
				}, -- End
				Recklessness = {
					Messages = {
						Start = "[LINK] activated!",
						End = "[LINK] faded!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				ShieldSlamDispel = {
					Messages = {
						Start = "Dispelled [TARGET]'s [AURALINK]!",
						End = "[TARGET] resisted [LINK]!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End
				ConcussionBlow = {
					Messages = {
						Start = "[LINK] on [TARGET]!",
						End = "[LINK] on [TARGET] has ended!",
					},
					CustomChannel = {
						Enabled = false,
						Channel = "",
					},
					Local = false,
					Raid = false,
					Party = false,
					Smart = {
						RaidParty = false,
						Say = false,
					},
				}, -- End				
			},
		},
	}, -- End Profile
} -- End Defaults
function RSA:OnInitialize()
	self.db = LibStub("AceDB-3.0"):New("RSADB", defaults) -- Setup Saved Variables
	self:SetSinkStorage(self.db.profile) -- Setup Saved Variables for LibSink
	-- Check what class we are and save it. Used to determine what options to show.
	local pClass = select(2, UnitClass("player"))
	self.db.profile.General.Class = pClass
	db = self.db
	-- Register /RSA command
	self:RegisterChatCommand("RSA", "ChatCommand")
	if tonumber(GetAddOnMetadata("RSA", "Version")) > tonumber(self.db.global.version) then -- Print when addon is updated.
	print("|cFFFF75B3Raeli's Spell Announcer|r updated to version " .. "|cff00FF00" .. GetAddOnMetadata("RSA", "Version") .. "|r.")
	end
	if tonumber(self.db.global.version) < 2.71 then -- Print when addon is updated from an old version.
		print(L.updated_message)
		local RWColor = {r=1, g=1, b=1}
		RaidNotice_AddMessage(RaidWarningFrame, format(L.updated_message), RWColor)
		--message(L.updated_message) -- Creates a Small "Ok" box with the message.
	end
	-- Register current version of RSA
	self.db.global.version = GetAddOnMetadata("RSA", "Version")
	-- Load Reminder Module on startup if it's turned on.
	if RSA.db.profile.Modules.Reminders == true then
		LoadAddOn("RSA_Reminders")
	else
		RSA.db.profile.Modules.Reminders_Loaded = false
	end
	if pClass == "DEATHKNIGHT" then -- Load Class Modules
		local loaded, reason = LoadAddOn("RSA_DeathKnight")
		if not loaded then
			RSA.db.profile.Modules.DeathKnight = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Death Knight " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Death Knight " .. L.OptionsMissing)
			end
		end
	elseif pClass == "DRUID" then
		local loaded, reason = LoadAddOn("RSA_Druid")
		if not loaded then
			RSA.db.profile.Modules.Druid = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Druid " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Druid " .. L.OptionsMissing)
			end
		end
	elseif pClass == "HUNTER" then
		local loaded, reason = LoadAddOn("RSA_Hunter")
		if not loaded then
			RSA.db.profile.Modules.Hunter = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Hunter " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Hunter " .. L.OptionsMissing)
			end
		end
	elseif pClass == "MAGE" then
		local loaded, reason = LoadAddOn("RSA_Mage")
		if not loaded then
			RSA.db.profile.Modules.Mage = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Mage " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Mage " .. L.OptionsMissing)
			end
		end
	elseif pClass == "PALADIN" then
		local loaded, reason = LoadAddOn("RSA_Paladin")
		if not loaded then
			RSA.db.profile.Modules.Paladin = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Paladin " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Paladin " .. L.OptionsMissing)
			end
		end
	elseif pClass == "PRIEST" then
		local loaded, reason = LoadAddOn("RSA_Priest")
		if not loaded then
			RSA.db.profile.Modules.Priest = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Priest " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Priest " .. L.OptionsMissing)
			end
		end
	elseif pClass == "ROGUE" then
		local loaded, reason = LoadAddOn("RSA_Rogue")
		if not loaded then
			RSA.db.profile.Modules.Rogue = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Rogue " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Rogue " .. L.OptionsMissing)
			end
		end
	elseif pClass == "SHAMAN" then
		local loaded, reason = LoadAddOn("RSA_Shaman")
		if not loaded then
			RSA.db.profile.Modules.Shaman = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Shaman " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Shaman " .. L.OptionsMissing)
			end
		end
	elseif pClass == "WARLOCK" then
		local loaded, reason = LoadAddOn("RSA_Warlock")
		if not loaded then
			RSA.db.profile.Modules.Warlock = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Warlock " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Warlock " .. L.OptionsMissing)
			end
		end
	elseif pClass == "WARRIOR" then
		local loaded, reason = LoadAddOn("RSA_Warrior")
		if not loaded then
			RSA.db.profile.Modules.Warrior = false
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Warrior " .. L.OptionsDisabled .. L.OptionsClass)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Warrior " .. L.OptionsMissing)
			end
		end
	end
end -- End OnInitialize
function RSA:OnProfileEnable() -- Need to fill this in better to make changing profiles without reloading possible.
	self.db = self.db.profile
	local pClass = select(2, UnitClass("player"))
		self.db.profile.class = pClass
end
function RSA:ChatCommand(input) -- Handle slash commands.
	input = strlower(input)
	local command1 = " - |cff33ff99".. "Config" .."|r - Opens global options."
	local command2 = " - |cff33ff99".. "Spell" .."|r - Opens spell options."
	local command3 = " - |cff33ff99".. "Reminders" .."|r - Opens buff reminder options."
	--/run InterfaceOptionsFrame_OpenToCategory("Profile","RSA")
	if not (input == "" or input == "config" or input == "reminders" or input == "help" or input == "spell") then
		print("|cFFFF75B3RSA:|r [" .. "|cff33ff99" .. input .. "|r] " .. "is not a valid command. " .. "Valid commands for |cff33ff99/rsa|r:")
		print(command1)
		print(command2)
		print(command3)
	elseif input == "config" or input == "" then
		local loaded, reason = LoadAddOn("RSA_Options")
		if not loaded then
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Options " .. L.OptionsDisabled)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Options " .. L.OptionsMissing)
			end
		end
	InterfaceOptionsFrame_OpenToCategory("Spell Options","RSA")
	InterfaceOptionsFrame_OpenToCategory("RSA","RSA")
	elseif input == "reminders" then
		local loaded, reason = LoadAddOn("RSA_Options")
		if not loaded then
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Options " .. L.OptionsDisabled)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Options " .. L.OptionsMissing)
			end
		end
	InterfaceOptionsFrame_OpenToCategory("Buff Reminders","RSA")
	elseif input == "spell" then
		local loaded, reason = LoadAddOn("RSA_Options")
		if not loaded then
			if reason == "DISABLED" or reason == "INTERFACE_VERSION" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Options " .. L.OptionsDisabled)
			elseif reason == "MISSING" or reason == "CORRUPT" then
				ChatFrame1:AddMessage("|cFFFF75B3RSA:|r Options " .. L.OptionsMissing)
			end
		end
	InterfaceOptionsFrame_OpenToCategory("Spell Options","RSA")
	end
end
--------------------------
---- Global Functions ----
--------------------------
function RSA_AnnouncementCheck() -- Checks against user settings to see if we are allowed to announce.
local InInstance, InstanceType = IsInInstance()
if RSA.db.profile.General.GlobalAnnouncements.OnlyInCombat and not InCombatLockdown() then return false end
if RSA.db.profile.General.GlobalAnnouncements.InPvP and UnitIsPVP("player") == 1 then return true end
if RSA.db.profile.General.GlobalAnnouncements.Arena and InstanceType == "arena" then return true end
if RSA.db.profile.General.GlobalAnnouncements.Battlegrounds and InstanceType == "pvp" then return true end
if RSA.db.profile.General.GlobalAnnouncements.InDungeon and InstanceType == "party" then return true end
if RSA.db.profile.General.GlobalAnnouncements.InRaid and InstanceType == "raid" then return true end
if RSA.db.profile.General.GlobalAnnouncements.InTolBarad and GetZoneText() == L["Tol Barad"] then return true end
if RSA.db.profile.General.GlobalAnnouncements.InWorld and InstanceType == "none" and GetZoneText() ~= L["Tol Barad"] and UnitIsPVP("player") ~= 1 then return true end
return false
end
function RSA_String_Replace(str) -- Used for custom messages to replace text.
	return RSA_Replacements [str] or str
end
function RSA_CopyText(text) -- Not used at the moment, but perhaps useful in the future.
ChatFrame1EditBox:Show();
ChatFrame1EditBox:SetFocus();
ChatFrame1EditBox:Insert(text);
ChatFrame1EditBox:HighlightText();
end
function RSA_Print_Self(message) -- Send a message to your default chat window.
	ChatFrame1:AddMessage("|cFFFF75B3RSA:|r " .. format(message))
end
function RSA_Print_LibSink(message) -- Sends a message set by LibSink-2.0
	RSA:Pour("|cFFFF75B3RSA:|r " .. message, 1, 1, 1)
end
function RSA_Print_Smart_RaidParty(message) -- Send a message to battleground, raid, party, or nothing, depending on group size or location.
local InInstance, InstanceType = IsInInstance()
	if RSA_AnnouncementCheck() == true then
		if InstanceType == "pvp" or InstanceType == "arena" then
			SendChatMessage(format(message), "BATTLEGROUND", nil)
		return end
		if GetNumRaidMembers() > 0 then
			SendChatMessage(format(message), "RAID", nil)
		elseif GetNumPartyMembers() > 0 then
			SendChatMessage(format(message), "PARTY", nil)
		end
	end
end
function RSA_Print_Raid(message) -- Send a message to raid or nothing. Additionally, will not try to send a message if in a Battleground or Arena.
local InInstance, InstanceType = IsInInstance()
	if RSA_AnnouncementCheck() == true then
		if GetNumRaidMembers() > 0 and InstanceType ~= "pvp" and InstanceType ~= "arena" then
			SendChatMessage(format(message), "RAID", nil)
		end
	end
end
function RSA_Print_Party(message) -- Send a message to party or nothing. Additionally, will not try to send a message if in a Battleground.
local InInstance, InstanceType = IsInInstance()
	if RSA_AnnouncementCheck() == true then
		if GetNumPartyMembers() > 0 and InstanceType ~= "pvp" then
			SendChatMessage(format(message), "PARTY", nil)
		end
	end
end
function RSA_Print_Channel(message, channel) -- Send a message to the custom channel that the user defines.
	if RSA_AnnouncementCheck() == true then
		if RSA.db.profile.General.GlobalAnnouncements.SmartCustomChannel == true then
			if GetNumRaidMembers() > 0 or GetNumPartyMembers() > 0 then
			SendChatMessage(format(message), "CHANNEL", nil, GetChannelName(channel))
			end
		elseif RSA.db.profile.General.GlobalAnnouncements.SmartCustomChannel == false then
			SendChatMessage(format(message), "CHANNEL", nil, GetChannelName(channel))
		end
	end
end
function RSA_Print_Self_RW(message) -- Send a message locally to the raid warning frame. Only visible to the user.
	local RWColor = {r=1, g=1, b=1}
	RaidNotice_AddMessage(RaidWarningFrame, "|cFFFF75B3RSA:|r " .. format(message), RWColor)
end
function RSA_Print_RW(message) -- Send a proper message to the raid warning frame.
	if RSA_AnnouncementCheck() == true then
		SendChatMessage(format(message), "RAID_WARNING", nil)
	end
end
function RSA_Print_Whisper(message, target) -- Send a whisper to the target.
	SendChatMessage(format(message), "WHISPER", nil, target)
end
function RSA_Print_Say(message) -- Send a message to Say.
	if RSA_AnnouncementCheck() == true then
		if RSA.db.profile.General.GlobalAnnouncements.SmartSay == true then
			if GetNumRaidMembers() > 0 or GetNumPartyMembers() > 0 then
				SendChatMessage(format(message), "SAY", nil)
			end
		elseif RSA.db.profile.General.GlobalAnnouncements.SmartSay == false then
			SendChatMessage(format(message), "SAY", nil)
		end
	end
end
function RSA_Reload_Link(message1, message2) -- Generates a message with a hyperlink to reload their UI.
ChatFrame1:AddMessage("|cFFFF75B3RSA:|r " .. format(message1) .. "|cffffa0a0|Hrldui:RSA|h[Reload]|h|r" .. format(message2))
end
function RSA_Talents() -- Detects which talent tree a user has primarily.
	if not GetTalentTabInfo( 1 ) then
		return -- Talents aren't loaded yet!
	end
	local specID = GetPrimaryTalentTree()
	if specID then
		return specID
	end
end
-------------------------------------------
---- Global Frames and Event Registers ----
-------------------------------------------
RSA_CombatLogMonitor = CreateFrame("Frame", "RSA:CLM")
RSA_CombatLogMonitor:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
RSA_ResMon = CreateFrame("Frame", "RSA:RM")
RSA_ResMon:RegisterEvent("UNIT_SPELLCAST_SENT")
--RSA_ResMon:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") -- Find another way to maintain target information, or use a different event.
